#include<cstdio>
struct employee
{
	char workid[20];
	char name[128];
	bool sex;//1 for men,0 for women
	char id[20];
	double salary;
	char address[128];
};
int i;
double n=0.0,m,h=0.0;
void init(struct employee &a);
void prin(struct employee &a);
int main()
{
	struct employee emp[8];
  for(i=0;i<8;i++)
   {  init(emp[i]);
      prin(emp[i]);
      n=n+emp[i].salary;
      if(h<emp[i].salary)
       h=emp[i].salary;
   }
   m=n/8;
   printf("their total salary is %lf\n",n);
   printf("their average salary is %lf\n",m);
   printf("the highest salary among them is %lf",h);
	return 0;
}
void init(struct employee &a)
{
	puts("Please enter the workid");
	gets(a.workid);
	puts("Please enter the name");
	gets(a.name);
	puts("Please enter the sex(1 for man 0 for woman)");
	scanf("%d",&a.sex);
	fflush(stdin);
	puts("Please enter the id");
	gets(a.id);
	puts("Please enter the salary");
	scanf("%lf",&a.salary);
	fflush(stdin);
	puts("Please enter the address");
	gets(a.address);
	return;
}
void prin(struct employee &a)
{
	printf("workid  %s\n",a.workid);
	printf("name    %s\n",a.name);
	printf("sex     ");
	if(a.sex)
	{
		puts("man");
	}
	else
	{
		puts("woman");
	}
	printf("id      %s",a.id);
	printf("salary  %lg\n",a.salary);
	printf("address %s\n",a.address);
	return;
}

